package com.demo.annotation.app;

import com.demo.annotation.app.config.MyConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppStart {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);

        //打印定义的Bean
        printDefinition(context);


        //关闭
        context.close();
    }


    private static void printDefinition(AnnotationConfigApplicationContext context){
        String[] beanDefinitionNames = context.getBeanDefinitionNames();


        for (int i = 0; i < beanDefinitionNames.length; i++) {
//            System.out.println(i+ " >>beanDefinitionName==============>>"+beanDefinitionNames[i]);
        }

    }
}
